#include <iostream>

using namespace std;

int main(){
	int startyear,endyear,sum;
	int i;
	sum =0;
	cin>>startyear>>endyear;
	for(i=startyear+1;i<endyear;i++){
		if((i%4==0 &&i%100!=0 )||i%400==0){
			sum=sum+i;	
		}
	}
	cout<<sum;
	cout<<sum;

	return 0;
}
